<template>
	<view>
		<view class="bg-white nav">
			<view class="flex text-center">
				<view class="cu-item flex-sub" :class="index==TabCur?'text-green cur':''" v-for="(item,index) in orderStatus" :key="index" @tap="tabSelect" :data-id="index">
					{{item.title}}
				</view>
			</view>
		</view>
		<view class="order-list">
			<view class="order" v-for="item in 5" :key="item" @click="goDetail()">
				<view class="order-cus">
					<view class="address">
						<text class="cuIcon-locationfill text-gray"></text>
						<text>53号402</text>
					</view>
					<view class="phone">
						<text>17521086309</text>
						<text class="cuIcon-phone text-gray"></text>
					</view>	
				</view>
				<view class="goods-info">
					<view class="goods-list">
						<view class="goods-item" v-for="item in 3" :key="item">
							<image class="goods-img" src="https://img.adidas.com.cn/resources/2019/7/26/15641286827893969_230X230.jpg"></image>
							<text class="goods-title">EDGE GAMEDAY 跑步运动鞋</text>
						</view>
					</view>
					<view class="price-count">
						<text>共3件</text>
						<text>共99元</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderStatus: [
					{
						title: '待结单',
						status: 0
					},
					{
						title: '处理中',
						status: 1
					}, 
					{
						title: '已完成',
						status: 2
					}, 
					{
						title: '已关闭',
						status: -1
					}
				],
				TabCur: 0,
			}
		},
		methods: {
			tabSelect(e) {
				this.TabCur = e.currentTarget.dataset.id;
			},
			goDetail() {
				uni.navigateTo({
					url: './orderDetail'
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	.bg-white{
		position: fixed;
		top: 0px;
		left: 0px;
		width: 100%;
		z-index: 1;
	}
	.order-list{
		margin-top: 100rpx;
	}
	.order{
		background-color: #FFF;
		padding: 15px;
		margin-top: 15px;
		.order-cus{
			display: flex;
			margin-bottom: 10px;
			justify-content: space-between;
			.address{
				
			}
			.phone{
				
			}
		}
	}
	.goods-info{
		display: flex;
		.goods-list{
			display: flex;
			flex: 1;
			overflow: hidden;
			.goods-item{
				overflow: hidden;
				.goods-img{
					width: 160rpx;
					height: 160rpx;
					border-radius: 5px;
				}
				.goods-title{
					display: block;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
				}
			}
		}
		.price-count{
			display: flex;
			flex-direction: column;
		}
	}
</style>
